<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String uuid = UUID.randomUUID().toString();
    request.setAttribute("uuid", uuid);
%>
<style type="text/css">
	.addOrderBtnCss{
		color: red;font-size: 14px;font-weight: bold;cursor: pointer; padding: 2px;
	}
	.riskWO{
		display: none;
	}
	.queryInputLabel{
		color: orange;
	}
	.autoInputLabel{
		color: #3399FF;
	}
</style>
<div class="container-fluid am-margin-top">
    	<form id="workOrderByUserForm">
	        <input type="hidden" name="zgdid"/>
	        <!-- 客户信息部分 -->
	        <ul class="nav nav-tabs" role="tablist">
				<li role="presentation" class="active">
					<a href="#${uuid}_clientDataTab" role="tab" data-toggle="tab">
						客户信息
					</a>
				</li>
			</ul>
			<div class="tab-content">
				<div role="tabpanel" class="tab-pane fade in  active am-margin-top-sm" id="${uuid}_clientDataTab">
			        <div class="row">
						<div class="col-md-3">
							<div class="form-group"><label>来电号码</label>
								<input type="text" name="ldhm" class="form-control" check-type="required">
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>创建时间</label>
								<div>2016-09-09 12:12:12</div>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>通话时长</label>
								<div>53秒</div>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>业务来源</label>
				                <pf:dataDic var="item" dicCode="YWLY">
				                </pf:dataDic>
				                <div>电话呼入</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-3">
							<div class="form-group"><label>客户姓名</label>
								<input type="text" name="khxm" class="form-control" check-type="required">
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>客户类型</label>
								<select class="form-control"  name="khlx" check-type="required">
					                <pf:dataDic var="item" dicCode="KHLX">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>客户语言</label>
								<select class="form-control"  name="khyy" check-type="required">
					                <pf:dataDic var="item" dicCode="KHYY">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group" style="padding-top: 25px;">
								<!-- 
								<a href="javascript:void(0)" id="searchOrderBt" class="btn btn-warning">保存更新</a>
								 -->
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- 客户信息部分结束 -->
		</form>
		<ul class="nav nav-tabs" role="tablist" id="orderNav">
			<li role="presentation" class="active">
				<a href="#${uuid}_fieldDataTab" role="tab" data-toggle="tab">
					工单信息
				</a>
			</li>
		</ul>
		<div class="tab-content" id="orderTab">
				<div role="tabpanel" class="tab-pane fade in  active am-margin-top-sx orderPane" id="${uuid}_fieldDataTab" label="工单">
		   	  	  <form id="workOrderForm">
		   	  	  	<input type="hidden" name="id"/>
		   	  	  	<input type="hidden" name="clid" value="${param.clid}"/>
		   	  	   　 <!-- 公共上部分 -->
					<div class="row">
						<div class="col-md-3">
							<div class="form-group"><label>业务类型</label>
								<select class="form-control"  name="ywlx" check-type="required">
					                <pf:dataDic var="item" dicCode="YWLX">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>子业务类型</label>
								<select class="form-control"  name="zywlx" check-type="required">
					                <pf:dataDic var="item" dicCode="ZYWLX">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>疑难投诉</label>
								<select class="form-control"  name="ynts" check-type="required">
					                <pf:dataDic var="item" dicCode="YNTS">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<!-- 客服工单部分 -->
						<div class="col-md-3 serviceWO">
							<div class="form-group"><label>客户诉求</label>
								<select class="form-control"  name="khsq" check-type="required">
					                <pf:dataDic var="item" dicCode="KHSQ">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<!-- 客服工单部分结束 -->
					</div>
					<!-- 公共上部分结束 -->
					
					<!-- 风控工单部分 -->
					<div class="row riskWO">
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">交易手机号是否银行预留手机号</label>
								<select class="form-control"  name="jysjhsfyhylsjh" disabled="disabled">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>交易手机号是否属于本人</label>
								<select class="form-control"  name="jysjhmsfbr" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>呼叫转移</label>
								<select class="form-control"  name="hjzy" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>短信拦截</label>
								<select class="form-control"  name="dxlj" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
					</div>
					<div class="row riskWO">
						<div class="col-md-3">
							<div class="form-group"><label>接收呼转号码</label>
								<input type="text" class="form-control"  name="jszyhm"/>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">受益人</label>
								<input type="text" class="form-control"  name="syr" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>是否认识受益人</label>
								<select class="form-control"  name="sfrssydx" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>是否认识交易手机</label>
								<select class="form-control"  name="sfrsjysj" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
					</div>
					<div class="row riskWO">
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">呼转号码归属地</label>
								<input type="text" class="form-control"  name="hzhmgsd" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">呼转号码运营商</label>
								<input type="text" class="form-control"  name="hzhmyys" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">受益人手机号</label>
								<input type="text" class="form-control"  name="syrsjh" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label class="autoInputLabel">受益人手机号归属地</label>
								<input type="text" class="form-control"  name="syrsjhgsd" readonly="readonly"/>
							</div>
						</div>
					</div>
					<div class="row riskWO">
						<div class="col-md-3">
							<div class="form-group"><label>与受益人关系</label>
								<select class="form-control"  name="ysydxgx" check-type="required">
					                <pf:dataDic var="item" dicCode="QSGX">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>手机品牌</label>
								<select class="form-control"  name="sjpp" check-type="required">
					                <pf:dataDic var="item" dicCode="SJPP">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>手机系统</label>
								<select class="form-control"  name="sjxt" check-type="required">
					                <pf:dataDic var="item" dicCode="SJXT">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>银行卡信息泄露</label>
								<select class="form-control"  name="yhkxxxl" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
					</div>
					<div class="row riskWO">
						<div class="col-md-3">
							<div class="form-group"><label>ID是否被盗</label>
								<select class="form-control"  name="idsfxl" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>ID注册邮箱</label>
								<select class="form-control"  name="idzcyx" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>是否报警</label>
								<select class="form-control"  name="sfbj" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
						<div class="col-md-3">
							<div class="form-group"><label>手机系统是否越狱</label>
								<select class="form-control"  name="sjsfyy" check-type="required">
					                <pf:dataDic var="item" dicCode="SF">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
					</div>
					<div class="row riskWO">
						<div class="col-md-12">
							<div class="form-group"><label>银行账号绑定业务情况</label>
								<pf:dataDic var="item" dicCode="BDYW">
					                    &nbsp;&nbsp;${item.name}&nbsp;<input type="checkbox" name="yhkbdyw" value="${item.value}">
					            </pf:dataDic>
					            <input type="text" class="form-control"  name="bdywbc" placeholder="其他说明"/>
							</div>
						</div>
					</div>
					<!-- 风控工单部分结束 -->
					
					<!-- 公共下部分 -->
					<div class="row">
						<div class="col-md-12">
							<div class="form-group"><label>客户投诉</label>
								<textarea name="khtsbt"  class="form-control" check-type="required"></textarea>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group"><label>受理情况</label>
								<textarea name="slqk"  class="form-control" check-type="required"></textarea>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
							<div class="form-group"><label class="autoInputLabel">关联交易笔数</label>
								<input type="text" class="form-control" id="tradCount" name="gljybs" value="0" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group"><label class="autoInputLabel">关联交易金额</label>
								<input type="text" class="form-control" id="tradJe" name="gljyje" value="0.00" readonly="readonly"/>
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group"><label class="autoInputLabel">关联交易</label>
								<div id="joinTrad">
									
								</div>
								<input type="hidden" name="joinTradIds" value=""/>
								<input type="hidden" name="joinTradKzs" value=""/>
							</div>
						</div>
					</div>
					<!-- 公共下部分结束 -->
					
					<!-- 关联工单检索条件 -->
					<div class="row">
						<div class="col-md-4">
							<div class="form-group"><label class="queryInputLabel">银行账号</label>
								<input type="text" name="syhzh" class="form-control">
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group"><label class="queryInputLabel">关联手机</label>
								<input type="text" name="sglsj" class="form-control">
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group" style="padding-top: 25px;">
								<button type="button" class="btn btn-warning" id="searchSelOrderBt">检索工单</button>
							</div>
						</div>
					</div>
					<!-- 关联工单检索条件结束 -->
					
					<!-- 关联交易列表 -->
				   	<div class="box-body">
						<table id="iWorkOrderSelGrid_${uuid}_d">
				   		</table>
					</div>
					<!-- 关联交易列表结束 -->
					
					<!-- 提交状态 -->
					<div class="row">
						<div class="col-md-4">
							<div class="form-group"><label>提交状态</label>
								<select class="form-control"  name="gdclzt" check-type="required">
					                <pf:dataDic var="item" dicCode="GDCLZT">
					                    <option value="${item.value}">${item.name}</option>
					                </pf:dataDic>
					            </select>
							</div>
						</div>
					</div>
					<!-- 提交状态结束 -->
					
				</div>
				<div role="tabpanel" class="tab-pane fade am-margin-top-sm" id="${uuid}_formViewTab">
	       	   </form>
			 </div>
		</div>
        <nav class="navbar navbar-default">
		  <div class="container-fluid">
		  	<div class="collapse navbar-collapse">
		  		<ul class="nav navbar-nav navbar-right">
			  		<li>
			  			<button type="button" class="btn btn-primary navbar-btn" id="iWorkOrderFormSaveBt">保存</button>
			  		</li>
			  	</ul>
	        </div>
		  </div>
		</nav>
</div>
<script type="text/javascript">
	
    $(function () {
    	
    	webUtils.nameSpace("wiseMen.workOrder");
    	
    	//查看交易详细
    	wiseMen.workOrder.tradingView=function(uuid,rowIndex){
    		var row = $("#iWorkOrderSelGrid_"+uuid+"_d").bootstrapTable("getRowByIndex", rowIndex);
    		var uuid=webUtils.uuid();
    		var d=webUtils.dialog({
    			url:ctx+"/dataModelDefAct/viewTpl.do?dms=DM_TRADING_ORDER&DM_TRADING_ORDER_ID="+row.ID+"&winId="+uuid
    		});
    	}
    	
    	//设置业务类型选择事件
    	wiseMen.workOrder.ywlxSelEventMod=function(){
    		var ywlx = $("div[role=tabpanel]").find("select[name=ywlx]");
    		ywlx.unbind("change");
    		ywlx.change(function(){
	    		var tab = $(this).parents("div[role=tabpanel]");
	    		if($(this).val()=='5'){//风控类
	    			tab.find(".serviceWO").hide();
	    			tab.find(".riskWO").show();
	    			tab.find("select[name=gdclzt]").find('option[value=2]').hide();
	    		}else{//客服类
	    			tab.find(".riskWO").hide();
	    			tab.find(".serviceWO").show();
	    			tab.find("select[name=gdclzt]").find('option[value=2]').show();
	    		}
	    		wiseMen.workOrder.setZywlxOptionMod($(this));
	    	});
    		var stab = ywlx.parents("div[role=tabpanel]");
    		if(ywlx.val()=='5'){//风控类
    			stab.find(".serviceWO").hide();
    			stab.find(".riskWO").show();
    			stab.find("select[name=gdclzt]").find('option[value=2]').hide();
    		}else{//客服类
    			stab.find(".riskWO").hide();
    			stab.find(".serviceWO").show();
    			stab.find("select[name=gdclzt]").find('option[value=2]').show();
    		}
    		//隐藏风控类子类型
    		wiseMen.workOrder.setZywlxOptionMod(ywlx);
    	}
    	//设置子业务类型选项
    	wiseMen.workOrder.setZywlxOptionMod=function(ywlx){
    		var tab = ywlx.parents("div[role=tabpanel]");
    		var zywlx = tab.find("select[name=zywlx]");
    		var options = zywlx.find('option');
    		var defaultVal = '';
    		$.each(options,function(index,o){
    			var obj = $(o);
    			if(obj.val().indexOf(ywlx.val()+'-')!=-1){
    				if(defaultVal==''){
    					defaultVal = obj.val();
    				}
    				obj.show();
    			}else{
    				obj.hide();
    			}
    		});
    		zywlx.val(defaultVal);
    	}
    	
    	//移除关联交易
    	wiseMen.workOrder.checkJoin=function(obj){
    		var id = $(obj).attr('id');
    		var ddh = $(obj).attr('ddh');
    		var je = $(obj).attr('je');
    		var kz = $(obj).attr('kz');
    		var data = $(obj).parents('div[id*=fieldDataTab]');
    		var trad = data.find("#joinTrad");
    		if($(obj).prop('checked')==true){
    			if(trad.find("#"+id).length==0){
    	    		trad.append('<span id="'+id+'" je="'+je+'" kz="'+kz+'">'+ddh+'<font style="color:red;cursor: pointer;" class="delJoinTrad" title="移除">X</font></span>&nbsp;');
    			}
    		}else{
    			trad.find("#"+id).remove();
    		}
    		wiseMen.workOrder.joinTradJs(trad,data);
    		$(".delJoinTrad").click(function(){
    			var did = $(this).parent().attr('id');
    			$(this).parent().remove();
    			var checkbox = data.find("input[type=checkbox][id="+did+"]");
    			checkbox.prop('checked',false);
    			wiseMen.workOrder.joinTradJs(trad,data);
    		});
    	}
    	//计算关联交易
    	wiseMen.workOrder.joinTradJs=function(trad,data){
    		var ts = trad.find('span');
    		var zje = 0.0;
    		var ids = '';
    		var kzs = '';
    		$.each(ts,function(index,t){
    			zje +=parseFloat($(t).attr('je'));
    			if(ids!=''){
    				ids +=',';
    				kzs +=',';
    			}
    			ids +=$(t).attr('id');
    			kzs +=$(t).attr('kz');
    		});
    		data.find('#tradCount').val(ts.length);
    		data.find('#tradJe').val(zje);
    		data.find('input[name=joinTradIds]').val(ids);
    		data.find('input[name=joinTradKzs]').val(kzs);
    	}
    	
    	//初始化关联交易列表方法    	
    	wiseMen.workOrder.addIndex = 1;
    	wiseMen.workOrder.renderId = '${uuid}';
    	wiseMen.workOrder.loadTableGrid=function(uuid,index){
	    	var iworkOrderSelGrid = $("#iWorkOrderSelGrid_"+uuid+"_d").bootstrapTable({
	        	url:ctx + "/queryDefAction/queryDatas.do?code=DM_TRADING_ORDER",
	        	columns:[
	    			{title: '关联' , field: 'ID' , width: "50px",formatter:function(data, row, index){
	    					return '<input type="checkbox" id="'+row.ID+'" ddh="'+row.YLDDH+'" je="'+row.JYJE+'" kz="'+row.KZ+'" onclick="javascript:wiseMen.workOrder.checkJoin(this);"></input>';
	    				}
	    			},
	    			{title: '开户姓名', field: 'KHXM'},
	    			{title: '交易手机', field: 'JYSJH'},
	    			{title: '银行卡号', field: 'YHZH'},
	    			{title: '银行', field: 'YH'},
	    			{title: '卡种', field: 'KZ'},
	    			{title: '商店名称', field: 'SDMC'},
	    			{title: '商品描述', field: 'SPMS'},
	                {title: '易联订单号', field: 'YLDDH'},
	                {title: '商户订单号', field: 'SHDDH'},
	                {title: '交易金额', field: 'JYJE'},
	                {title: '人民币金额', field: 'RMBJE'},
	                {title: '交易时间', field: 'JYSJ'},
	                {title: '状态', field: 'DDZT'},
	                {title: '支付结果', field: 'ZFJG'},
	                {title: '详细', field: 'ID',formatter:function(data, row, index){
	                	var btn = '<button data-rowindex="0" type="button" title="查看" class="btn btn-default btn-xs am-margin-left-xs am-margin-vertical-xs inGridOptBtn" onclick="javascript:wiseMen.workOrder.tradingView(\''+uuid+'\',\''+index+'\')"><span class="glyphicon glyphicon-search"></span></button>';
	                	return btn;
	                }}
	        	],
	    	    queryParams: function(d) {
	    	        var yhzh = $("#"+uuid+"_fieldDataTab"+index).find("input[name=syhzh]").val();
	    	        var yjsjh = $("#"+uuid+"_fieldDataTab"+index).find("input[name=sglsj]").val();
	    	        d.searchData = JSON.stringify({YHZH:yhzh,JYSJH:yjsjh});
	    	        return d;
	    	    }
	        });
	        $("#"+uuid+"_fieldDataTab"+index).find("#searchSelOrderBt").click(function(){
	        	iworkOrderSelGrid.bootstrapTable("refresh");
	        });
    	}
    	//初始化第一个工单所关联的交易列表
    	wiseMen.workOrder.loadTableGrid(wiseMen.workOrder.renderId,'');
    	
    	//加载表单初始化数据
        var id = '${param.id}';
        var clid = '${param.clid}';
        var winId = '${param.winId}';
        $("#workOrderByUserForm").validation();
        $("#workOrderForm").validation();
        if (id) {
            $.getJSON(ctx + '/workOrderAct/queryWorkOrderById.do', {id: id}, function (data) {
                //初始化表单数据
            	webUtils.fullForm({
                    form: $("#workOrderByUserForm"),
                    data: data.order
                });
                webUtils.fullForm({
                    form: $("#workOrderForm"),
                    data: data.order
                });
                //初始化已关联交易
                var tradIds = '';
                var tradKzs = '';
                $.each(data.joinTrad,function(index,obj){
                    if(tradIds!=''){
                    	tradIds+=',';
                    	tradKzs+=',';
                    }
                    tradIds+=obj.TID;
                    tradKzs+=obj.KZ;
                	$("#joinTrad").append('<span id="'+obj.TID+'" je="'+obj.JYJE+'" kz="'+obj.KZ+'">'+obj.YLDDH+'<font style="color:red;cursor: pointer;" class="delJoinTrad" title="移除">X</font></span>&nbsp;');
                });
                $(".delJoinTrad").click(function(){
        			var did = $(this).parent().attr('id');
        			$(this).parent().remove();
        			wiseMen.workOrder.joinTradJs($("#joinTrad"),$("#orderTab"));
        		});
                $("input[name=joinTradIds").val(tradIds);
                $("input[name=joinTradKzs").val(tradKzs);
				//初始化风控/客服可见数据项
            	wiseMen.workOrder.ywlxSelEventMod();
            });
        }
        
        //提交保存数据        
        $("#iWorkOrderFormSaveBt").click(function () {
    		var selJoin = $("input[id=tradCount]");
    		var isSelJoin = true;
    		$.each(selJoin,function(index,obj){
    			if($.trim($(obj).val())=='0'){
    				isSelJoin = false;
    			}
    		});
			var userDataForm=$("#workOrderByUserForm");
			var userDataFormObj=webUtils.formToObj(userDataForm);
			var orderDataForms=$("#workOrderForm");
			var orderDataFormObj = webUtils.formToObj(orderDataForms);
			orderDataFormObj.yhkbdyw = wo.join(orderDataFormObj.yhkbdyw,',');
        	if($("#workOrderByUserForm").valid() && $("#workOrderForm").valid()){
        		if(!isSelJoin){
                    alert("请选择关联的交易记录！");
                    return false;
        		}
        		var tips = "";
            	$.each($(".orderPane"),function(index,o){
            		var obj = $(o);
            		var sel = obj.find("select[name=gdclzt]");
            		tips += obj.attr("label")+"【提交状态："+sel.find("option[value="+sel.val()+"]").text()+"】<br/>";
            	});
            	tips += "确认是否提交？";
            	layer.confirm(tips, {
            		  btn: ['提交','取消'] //按钮
          		}, function(index){
	        		$.post(ctx + '/workOrderAct/updWorkOrder.do',{userDatas:Base64.encode(JSON.stringify(userDataFormObj)),
	        				orderDatas:Base64.encode(JSON.stringify(orderDataFormObj))},function (data) {
	                        if (data.success) {
	                            webUtils.alert("提交成功");
	                            top.webUtils.topicPublish("dialog.submit.success."+winId, data);
	                        } else {
	                        	webUtils.error(data.msg);
	                        }
	                    }
	                );
	        		layer.close(index);
          		}, function(){
          		  
          		});
        		
        	}
        });
        
    });    
</script>
